#include "GameMessageFactory.h"

GameMessage* GameMessageFactory::Create(const std::string &name)
{
	Function f = m_map[name];
	if (f)
	{
		return f();
	}
	return 0;
}

bool GameMessageFactory::AddType(const std::string &name, GameMessageFactory::Function f)
{
	m_map[name] = f;
	return true;
}